package com.tdkj.model.website;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.tdkj.model.base.BaseEntity;

/**
 * XnkyProtocol entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "website_protocol")
public class BeanProtocol extends BaseEntity{

	// Fields
	private String code;
	private String title;
	private String protocoltype;
	private String content;
	private Timestamp createtime;
	private Set<BeanProtocolDetail> protocolDetails = new HashSet<BeanProtocolDetail>(0);

	// Constructors

	/** default constructor */
	public BeanProtocol() {
	}

	/** minimal constructor */
	public BeanProtocol(long id) {
		this.setId(id);
	}

	/** full constructor */
	public BeanProtocol(long id,String code, String title, String protocoltype,
			String content, Timestamp createtime,
			Set<BeanProtocolDetail> protocolDetails) {
		this.setId(id);
		this.code = code;
		this.title = title;
		this.protocoltype = protocoltype;
		this.content = content;
		this.createtime = createtime;
		this.protocolDetails = protocolDetails;
	}

	@Column(name = "code", length = 40)
	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	@Column(name = "title", length = 40)
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "protocoltype", length = 40)
	public String getProtocoltype() {
		return this.protocoltype;
	}

	public void setProtocoltype(String protocoltype) {
		this.protocoltype = protocoltype;
	}

	@Column(name = "content", length = 800)
	public String getContent() {
		return this.content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@Column(name = "createtime",length = 19)
	public Timestamp getCreatetime() {
		return this.createtime;
	}

	public void setCreatetime(Timestamp createtime) {
		this.createtime = createtime;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "protocol")
	public Set<BeanProtocolDetail> getProtocolDetails() {
		return this.protocolDetails;
	}

	public void setProtocolDetails(
			Set<BeanProtocolDetail> protocolDetails) {
		this.protocolDetails = protocolDetails;
	}

}